package com.zzyl.serve.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.domain.NursingTask;
import com.zzyl.nursing.vo.NursingTaskByIdVo;
import com.zzyl.serve.domain.NursingTaskDto;
import com.zzyl.serve.domain.NursingTaskVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * TODO
 *
 * @Date 2025/10/29 16:18
 */
@Mapper
public interface NursingFvkMapper extends BaseMapper<NursingTask> {

    @Select("select nt.*,e.name,e.sex,e.id_card_no,ci.nursing_level_name from nursing_task nt left join elder e on nt.elder_id = e.id\n" +
            "                           left join nursing_project np on nt.project_id = np.id left join sys_user su on nt.update_by=su.user_id\n" +
            "                        left join check_in ci on nt.elder_id=ci.elder_id where nt.id=#{id}")
    NursingTaskByIdVo selectBuSql(@Param("id") Integer id);


    List<NursingTaskVo> pageList(NursingTaskDto dto);
}
